/**
 * @param {number[]} nums
 * @return {number}
 */
var findRepeatNumber = function(nums) {
    let array = nums.sort((a,b) => {
        return a - b
    })
    for (let i = 0; i < array.length; i++) {
        if (array[i] == array[i+1]) {
            return array[i]
        }
    }
};
var findRepeatNumber = function(nums) {
    let array = Array(nums.length).fill(0)
    for (let i = 0; i < nums.length; i++) {
        array[nums[i]]++;
    }
    for (let i = 0; i < array.length; i++) {
        if (array[i] > 1) {
            return i;
        }
    }
}
let nums = [2,3,1,0,2,5,3]
console.log(findRepeatNumber(nums))